package com.smz.controller;

import com.smz.entity.TPar;
import com.smz.service.TRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TRelationController {

    @Autowired
    TRelationService tRelationService;

    @PostMapping("/relation/{mage}")
    public ResponseEntity<String> addRelation(@RequestBody TPar tPar, @PathVariable("mage")String mage){
        return ResponseEntity.ok(tRelationService.addTRelation(tPar,mage));
    }
}
